package com.iqiyi.pps.epg.core.model.carousel;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by Lemuel on 2016/6/28.
 */
@Entity
@Table(name = "autocarousel_episode_library")
@Cache(usage = CacheConcurrencyStrategy.NONE)
public class AutoCarouselEpisodeLibrary implements IIndexSort{

    public static final int STATUS_DELETE = -1;
    public static final int STATUS_DEFAULT = 0;

    public static final int EXECUTE_RESULT_DEFAULT = 0;
    public static final int EXECUTE_RESULT_SUCCESS = 1;
    public static final int EXECUTE_RESULT_FAILED = -1;

    private long id;
    private long fatherId;
    private long qipuId;
    private String programName;
    private long albumId;
    private String albumName;
    private String channelName;
    private String globalPublishDate;
    private long duration;
    private String pagePublishStatus;
    private long copyrightEndTime;
    private int status;
    private long execIndex;
    private long lastSortTime;
    private int execResult;
    private Timestamp createdTime;
    private Timestamp updateTime;
    private String opUser;

    private String twAlbumName;
    private String twProgramName;
    private String twChannelName;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Column(name = "father_id")
    public long getFatherId() {
        return fatherId;
    }

    public void setFatherId(long fatherId) {
        this.fatherId = fatherId;
    }

    @Column(name = "qipu_id")
    public long getQipuId() {
        return qipuId;
    }

    public void setQipuId(long qipuId) {
        this.qipuId = qipuId;
    }

    @Column(name = "program_name")
    public String getProgramName() {
        return programName;
    }

    public void setProgramName(String programName) {
        this.programName = programName;
    }

    @Column(name = "album_id")
    public long getAlbumId() {
        return albumId;
    }

    public void setAlbumId(long albumId) {
        this.albumId = albumId;
    }

    @Column(name = "album_name")
    public String getAlbumName() {
        return albumName;
    }

    public void setAlbumName(String albumName) {
        this.albumName = albumName;
    }

    @Column(name = "channel_name")
    public String getChannelName() {
        return channelName;
    }

    public void setChannelName(String channelName) {
        this.channelName = channelName;
    }

    @Column(name = "global_publish_date")
    public String getGlobalPublishDate() {
        return globalPublishDate;
    }

    public void setGlobalPublishDate(String globalPublishDate) {
        if (null == globalPublishDate){
            this.globalPublishDate = "";
        }
        this.globalPublishDate = globalPublishDate;
    }

    @Column(name = "duration")
    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    @Column(name = "page_publish_status")
    public String getPagePublishStatus() {
        return pagePublishStatus;
    }

    public void setPagePublishStatus(String pagePublishStatus) {
        this.pagePublishStatus = pagePublishStatus;
    }

    @Column(name = "copyright_end_time")
    public long getCopyrightEndTime() {
        return copyrightEndTime;
    }

    public void setCopyrightEndTime(long copyrightEndTime) {
        this.copyrightEndTime = copyrightEndTime;
    }

    @Column(name = "status")
    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Column(name = "exec_index")
    public long getExecIndex() {
        return execIndex;
    }

    public void setExecIndex(long execIndex) {
        this.execIndex = execIndex;
    }

    @Column(name = "last_sort_time")
    public long getLastSortTime() {
        return lastSortTime;
    }

    public void setLastSortTime(long lastSortTime) {
        this.lastSortTime = lastSortTime;
    }

    @Column(name = "exec_result")
    public int getExecResult() {
        return execResult;
    }

    public void setExecResult(int execResult) {
        this.execResult = execResult;
    }

    @Column(name = "created_time")
    public Timestamp getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Timestamp createdTime) {
        this.createdTime = createdTime;
    }

    @Column(name = "update_time" ,insertable = false, updatable = false)
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Column(name = "op_user")
    public String getOpUser() {
        return opUser;
    }

    public void setOpUser(String opUser) {
        this.opUser = opUser;
    }

    @Column(name = "tw_album_name")
    public String getTwAlbumName() {
        return twAlbumName;
    }

    public void setTwAlbumName(String twAlbumName) {
        this.twAlbumName = twAlbumName;
    }

    @Column(name = "tw_program_name")
    public String getTwProgramName() {
        return twProgramName;
    }

    public void setTwProgramName(String twProgramName) {
        this.twProgramName = twProgramName;
    }

    @Column(name = "tw_channel_name")
    public String getTwChannelName() {
        return twChannelName;
    }

    public void setTwChannelName(String twChannelName) {
        this.twChannelName = twChannelName;
    }
}
